<template>
  <div class="problem_ranking">
    <el-table :data="tableData" :height="height" style="width: 100%">
      <el-table-column prop="name" label="姓名"> </el-table-column>
      <el-table-column prop="prevailingTrend" label="题目热度"> </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      height: "",
      tableData: [
        {
          name: "",
          prevailingTrend: "",
        },
      ],
    };
  },
  mounted() {
    let that = this;
    // 初始化
    window.fullHeight = document.documentElement.clientHeight;
    window.fullWidth = document.documentElement.clientWidth;
    that.windowHeight = window.fullHeight; // 高
    that.windowWidth = window.fullWidth; // 宽
    this.height = that.windowHeight/100*44;
    this.$axios({
      method: "GET",
      url: "http://81.70.192.34:8088/statistics/problem",
    }).then((res) => {
      if (res.data.code == 200) {
        console.log(res.data)
        this.tableData = res.data.data;
      } else {
      }
    }).catch((error) => {
          console.error(error);
    });

  }
};
</script>

<style scoped>
.problem_ranking {

}
</style>